package com.lxj.controller;

import com.lxj.domain.Education;
import com.lxj.service.EducationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@ResponseBody
@Controller
@RequestMapping("/education")
public class EducationController {
    @Autowired
    private EducationService educationService;
    @PostMapping("/selectAll")
    public List<Education> selectAll(Education education){
        List<Education> list = educationService.selectAll(education);
        return list;
    }
    @GetMapping("/delete")
    public int delete(Integer[] id){
        return educationService.delete(id);
    }
    @GetMapping("add")
    public int add(Education education){
        return educationService.add(education);
    }
    @PostMapping("/edit")
    public int edit(Education education){
        return educationService.edit(education);
    }
    @PostMapping("/findById")
    public Education findById(Integer id){
        return educationService.findById(id);
    }
}
